Field of the Disclosure
The present disclosure relates to a communication apparatus, a communication method, and a storage medium, and more particularly relates to a communication apparatus, a communication method, and a storage medium suitably used for a communication with an external device.
Description of the Related Art
Communication protocols include Hypertext Transfer Protocol version 1.1 (HTTP/1.1) used as an Internet standard technology (https://tools.ietf.org/html/rfc2616), and HTTP/2, as a new version of HTTP, of which the standardization is currently being performed by an Internet standardization organization (Internet Engineering Task Force (IETF)) (https://tools.ietf.org/html/rfc7540).
When HTTP/1.1 is used, a server and a client are connected to each other through a transmission control protocol (TCP) connection, and the client transmits a request to the server through the connection. The client cannot transmit a next request until the client receives a response to the request returned from the server. However, if a plurality of TCP connections is used, the client can transmit, in parallel, as many requests as the TCP connections used.
On the other hand, when HTTP/2 is used, a plurality of logical sessions, i.e., streams, is established (multiplexing) in a TCP connection between a server and a client. The client can transmit requests in parallel through the respective streams. Thus, when HTTP/2 is used, the requests can be transmitted in parallel without being restricted by the number of established TCP connections.
However, it does not necessarily mean that communications can be completed in a short period by using one of the communication protocols HTTP/1.1 and HTTP/2 at all times.
For example, when requests more than the number of TCP connections are transmitted in using HTTP/1.1, some of the requests cannot be transmitted until the responses to the requests are returned. Thus, time required for returning responses to the requests becomes longer.
On the other hand, with the feature of HTTP/2, since the number of streams is not limited by the number of TCP connections, all the requests can be transmitted in parallel without the need of waiting for responses to the requests. Thus, HTTP/2 can achieve a shorter response time to the requests than that when HTTP/1.1 is used.
However, communications may be completed in a longer period of time in a case where HTTP/2 is used than in a case where HTTP/1.1 is used, for example, when a single HTTP request is transmitted. To start communications using HTTP/2, protocol upgrade needs to be performed when the communications are started. The communication protocol upgrade using a protocol upgrade mechanism involves an additional transaction between the server and the client. Thus, communications may be completed in a longer period in a case where HTTP/2 is used than in a case where HTTP/1.1 is used. This problem not only occurs between HTTP/1.1 and HTTP/2, but also occurs between HTTP/1.1 and SPDY™ (pronounced speedy) and between HTTP/1.1 and Quick User Datagram Protocol (UDP) Internet Connections (QUIC), for example.